package org.adoxx.adows.client.main; import java.io.IOException; import java.io.InputStream; import java.util.HashSet; import java.util.Properties; import javax.xml.rpc.ServiceException; import org.adoxx.adows.client.ADOxxWebService; import com.boc_eu.adoweb.adows.adoscript.GetModelsXML; /** * @author wutz * * Sample implementation to retreive the content of models from an * ADOxx based tool via web-service interaction. * * FIXME: the return XML is currently available as a XML in String * format, in case further steps are needed, parsing of the return needs * to be implemented. * * FIXME: the modelids are hard-coded and needs to be dynamically * retrieved from TOC interaction * */ public class RunADOxxServiceInteractionModelsXML { public static void main(String[] args) throws ServiceException, IOException { // load property for endpoint reference Properties prop = new Properties(); InputStream inputStream = RunADOxxServiceInteractionModelDocuXML.class.getClassLoader().getResourceAsStream("config.properties"); prop.load(inputStream); // Construct the ADOxx service as a singleton in the application. ADOxxWebService service = ADOxxWebService.getInstance(prop.getProperty("endpoint")); // create the set of modelids HashSet modelIDs = new HashSet(); modelIDs.add(11201); // Create the interaction object, using the service, a set of modelids // and/or modelgroupids and a // boolean if record rows should be included as an input, // implictly triggers the service interaction, the returned XML is in // accordance with the schema available here // http://www.adoxx.org/AdoScriptDoc/files/Message_Ports/Component_APIs/Documentation/XML_MODELS-js.html#XML_MODELS GetModelsXML modelsXML = new GetModelsXML(service, modelIDs, null, true); // Handle the results System.out.println(modelsXML.getResult()); } }